{include file="common/comm_header" /}
  
<body>

  <div class="layui-anim layui-anim-up">
    <div class="x-nav">
      <span class="layui-breadcrumb">
        <a href="">留言管理</a>
        <a href="">留言列表</a>
      </span>
      <a class="layui-btn layui-btn-small" style="line-height:1.6em;margin-top:3px;float:right" href="javascript:window.location.reload();" title="刷新">
        <i class="layui-icon" style="line-height:40px">ဂ</i></a>
    </div>
    <div class="x-body">
      <blockquote class="layui-elem-quote">
        <h2>直接回复则表示通过审核，若评论非法请直接修改状态！</h2>
      </blockquote>
      <table class="layui-table layui-form">
        <thead>
        <tr>
          <th>评论ID</th>
          <th>父级ID</th>
          <th>昵称</th>
          <th>回复数</th>
          <th>联系邮箱</th>
          <th>内容</th>
          <th>回复状态</th>
          <th>展示状态</th>
          <th>IP</th>
          <th>创建时间</th>
          <th>回复时间</th>
          <th>操作</th>
        </tr>
        </thead>
        <tbody class="x-cate">
        {if condition="empty($indexDataList)"}
        <tr cate-id='0' fid='0' >
          <td colspan="12" style="text-align: center;">
            <h1><font color="#8b0000">暂时没有任何数据</font></h1>
          </td>
        </tr>
        {else /}
        {volist name="indexDataList" id="vo"}
        <tr cate-id='{$vo.com_id}' fid='{$vo.parent_com_id}' >
          <td>{$vo.com_id}</td>
          <td>{$vo.parent_com_id}</td>
          <td>
            {if condition="$vo.son_num > 0"}
            <i class="layui-icon x-show" status='true'>&#xe623;</i>
            {/if}
            {$vo.com_title}
          </td>
          <td>{$vo.son_num}</td>
          <td>{$vo.com_email}</td>
          <td>
            {$vo.com_content}
          </td>
          <td class="td-status">
            {eq name="$vo.com_reply_status" value="1"}
            <span class="layui-btn layui-btn-normal layui-btn-mini">已回复</span>
            {else/}
            <span class="layui-btn  layui-btn-warm layui-btn-mini">未回复</span>
            {/eq}
          </td>
          <td class="td-status">
            {if condition="$vo.com_show_status == 0"}
            <span class="layui-btn  layui-btn-warm layui-btn-mini">未审核</span>
            {elseif condition="$vo.com_show_status eq 1"/}
            <span class="layui-btn layui-btn-mini">审核通过</span>
            {else /}
            <span class="layui-btn layui-btn-danger layui-btn-mini">审核不通过</span>
            {/if}
          </td>
          <td>{$vo.com_ip}</td>
          <td>{$vo.create_time}</td>
          <td>{$vo.update_time}</td>
          <td class="td-manage">
            <button class="layui-btn layui-btn-xs"  href="javascript:;" onclick="reply({$vo.com_show_status},{$vo.com_id})">
              <i class="layui-icon">&#xe642;</i>
              回复
            </button>
            <br/>

            <button class="layui-btn-danger layui-btn layui-btn-xs" href="javascript:;"  onclick="x_admin_show('修改状态','/{$Think.ADMIN_ROUT_PREFIX}/leave-review?id={$vo.com_id}&show_status={$vo.com_show_status}',800,700)">
              <i class="layui-icon">&#xe640;</i>
              修改状态
            </button>
          </td>
        </tr>
        {volist name="$vo.child" id="son"}
        <tr cate-id='{$son.com_id}' fid='{$son.show_parent_id}' >
          <td>{$son.com_id}</td>
          <td>{$son.parent_com_id}</td>
          <td>
            &nbsp;&nbsp;&nbsp;&nbsp;
            {$son.com_title}
          </td>
          <td></td>
          <td>{$son.com_email}</td>
          <td>
            {$son.com_content}
          </td>
          <td class="td-status">
            <!--{eq name="$son.com_reply_status" value="1"}-->
            <!--<span class="layui-btn layui-btn-normal layui-btn-mini">已回复</span>-->
            <!--{else/}-->
            <!--<span class="layui-btn  layui-btn-warm layui-btn-mini">未回复</span>-->
            <!--{/eq}-->
          </td>
          <td class="td-status">
            <!--{if condition="$son.com_show_status == 0"}-->
            <!--<span class="layui-btn  layui-btn-warm layui-btn-mini">未审核</span>-->
            <!--{elseif condition="$son.com_show_status eq 1"/}-->
            <!--<span class="layui-btn layui-btn-mini">审核通过</span>-->
            <!--{else /}-->
            <!--<span class="layui-btn layui-btn-danger layui-btn-mini">审核不通过</span>-->
            <!--{/if}-->
          </td>
          <td>{$son.com_ip}</td>
          <td>{$son.create_time}</td>
          <td>{$son.update_time}</td>
          <td class="td-manage">
          </td>
        </tr>
        {/volist}
        {/volist}
        {/if}
        </tbody>
      </table>
    </div>
  </div>
  
    <a href="#" class="to-top"><i class="layui-icon" style="font-size: 30px">&#xe68e;</i></a>
    <script type="text/javascript" src="/static/common/js/jquery.min.js"></script>
    <script type="text/javascript" src="/static/common/js/jquery.toTop.min.js"></script>
    <script type="text/javascript" src="/static/admin/lib/layui/layui.js" charset="utf-8"></script>
    <script type="text/javascript" src="/static/admin/js/xadmin.js"></script>
    <!-- 让IE8/9支持媒体查询，从而兼容栅格 -->
    <!--[if lt IE 9]>
    <script src="/static/common/js/html5.min.js"></script>
    <script src="/static/common/js/respond.min.js"></script>
    <![endif]-->
    <script>
      function reply(show_status,com_id){
        if(show_status == 2){
          layer.alert('这个留言已经审核不通过了，就别回复了！', {
            icon: 6,
            time: 2500
          });
          return false;
        }
        var url = '/{$Think.ADMIN_ROUT_PREFIX}/leave-reply?id='+com_id;
        x_admin_show('回复',url,800,700);
      }
    </script>
  </body>

{include file="common/comm_bottom" /}